<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

///**
// * 前台路由指向
// */
//Route::group(['prefix' => 'main', 'namespace' => 'Main'], function () {
//    Route::get('/', 'IndexController@index');
//});

/**
 * 后台路由指向
 */
Route::group(['prefix' => 'manage', 'namespace' => 'Manage'], function () {
        Route::get('login', 'ManageController@login');
        Route::get('captcha', 'ManageController@captcha');
        Route::post('login', 'ManageController@verify');
    }
);

/**
 * 系统配置管理
 */
Route::group(['prefix' => 'manage', 'namespace' => 'Manage', 'middleware' => 'manage'], function() {
        #首页
        Route::get('/', 'IndexController@index');
        Route::get('index', 'IndexController@index');

        #数据字典
        Route::get('dictionary', 'DictionaryController@index');

        #系统配置
            #设置系统配置状态
            Route::get('config/status', 'ConfigController@setStatus');
            #系统配置
            Route::resource('config','ConfigController');

        #管理员
            #注销
            Route::get('logout', 'ManageController@logout');
            #设置管理员状态
            Route::get('user/status', 'UserController@setStatus');
            #管理员列表页
            Route::get('user','UserController@index');
            #载入添加页
            Route::get('user/create','UserController@create');
            #提交数据
            Route::post('user/store','UserController@store');
            #载入修改页
            Route::get('user/{id}/edit','UserController@edit');
            #修改数据
            Route::post('user/update/{id}','UserController@update');
            #删除管理员
            Route::get('user/delete','UserController@destroy');
            #载入修改密码页
            Route::get('password','UserController@password');
            #修改密码
            Route::post('change_pass','UserController@change_pass');

        #角色管理
            #设置角色状态
            Route::get('role/status', 'RoleController@setStatus');
            #角色管理
            Route::resource('role','RoleController');

        #授权管理
            #修改权限
            Route::get('rule/set_rule', 'RuleController@setRule');
            #权限列表页
            Route::get('rule','RuleController@index');
            #载入添加页
            Route::get('rule/create','RuleController@create');
            #提交数据
            Route::post('rule/store','RuleController@store');
            #删除关于我们
            Route::get('rule/delete','RuleController@destroy');

        #客户管理
            #客户状态管理
            Route::get('client/status','ClientController@status');
            #客户列表页
            Route::get('client','ClientController@index');
            #载入添加页
            Route::get('client/create','ClientController@create');
            #提交客户数据
            Route::post('client/store','ClientController@store');
            #载入修改页
            Route::get('client/{id}/edit','ClientController@edit');
            #修改客户数据
            Route::post('client/update/{id}','ClientController@update');
            #删除客户
            Route::get('client/delete','ClientController@destroy');
            #导入页
            Route::get('import','ClientController@import');
            #导入数据
            Route::post('client/input','ClientController@input');
            #分配任务
            Route::post('client/task','ClientController@task');

        #关于我们
            #设置模块状态
            Route::get('about/status', 'AboutController@status');
            #关于我们列表页
            Route::get('about','AboutController@index');
            #载入添加页
            Route::get('about/create','AboutController@create');
            #提交数据
            Route::post('about/store','AboutController@store');
            #载入修改页
            Route::get('about/{id}/edit','AboutController@edit');
            #修改数据
            Route::post('about/update/{id}','AboutController@update');
            #删除关于我们
            Route::get('about/delete','AboutController@destroy');

        #文章分类管理
            #文章分类状态管理
            Route::get('article_category/status','ArticleCategoryController@status');
            #文章分类列表页
            Route::get('article_category','ArticleCategoryController@index');
            #载入添加页
            Route::get('article_category/create','ArticleCategoryController@create');
            #提交文章分类数据
            Route::post('article_category/store','ArticleCategoryController@store');
            #载入修改页
            Route::get('article_category/{id}/edit','ArticleCategoryController@edit');
            #修改文章分类数据
            Route::post('article_category/update/{id}','ArticleCategoryController@update');
            #删除文章分类
            Route::get('article_category/delete','ArticleCategoryController@destroy');

        #文章管理
            #文章状态管理
            Route::get('article/status','ArticleController@status');
            #文章列表页
            Route::get('article','ArticleController@index');
            #载入添加页
            Route::get('article/create','ArticleController@create');
            #提交文章数据
            Route::post('article/store','ArticleController@store');
            #载入修改页
            Route::get('article/{id}/edit','ArticleController@edit');
            #修改文章数据
            Route::post('article/update/{id}','ArticleController@update');
            #删除文章
            Route::get('article/delete','ArticleController@destroy');


        #留言管理
            #留言内容
            Route::get('feedback/detail/{id}','FeedbackController@detail');
            #留言列表页
            Route::get('feedback','FeedbackController@index');
            #删除产品分类
            Route::get('feedback/delete','FeedbackController@destroy');

        #产品分类管理
            #产品分类状态管理
            Route::get('product_category/status','ProductCategoryController@status');
            #产品分类列表页
            Route::get('product_category','ProductCategoryController@index');
            #载入添加页
            Route::get('product_category/create','ProductCategoryController@create');
            #提交产品分类数据
            Route::post('product_category/store','ProductCategoryController@store');
            #载入修改页
            Route::get('product_category/{id}/edit','ProductCategoryController@edit');
            #修改产品分类数据
            Route::post('product_category/update/{id}','ProductCategoryController@update');
            #删除产品分类
            Route::get('product_category/delete','ProductCategoryController@destroy');

        #产品管理
            #产品状态管理
            Route::get('product/status','ProductController@status');
            #产品列表页
            Route::get('product','ProductController@index');
            #载入添加页
            Route::get('product/create','ProductController@create');
            #提交产品数据
            Route::post('product/store','ProductController@store');
            #载入修改页
            Route::get('product/{id}/edit','ProductController@edit');
            #修改产品数据
            Route::post('product/update/{id}','ProductController@update');
            #删除产品
            Route::get('product/delete','ProductController@destroy');

        #广告分类管理
            #广告分类状态管理
            Route::get('ad_category/status','AdCategoryController@status');
            #广告分类列表页
            Route::get('ad_category','AdCategoryController@index');
            #载入添加页
            Route::get('ad_category/create','AdCategoryController@create');
            #提交广告分类数据
            Route::post('ad_category/store','AdCategoryController@store');
            #载入修改页
            Route::get('ad_category/{id}/edit','AdCategoryController@edit');
            #修改广告分类数据
            Route::post('ad_category/update/{id}','AdCategoryController@update');
            #删除广告分类
            Route::get('ad_category/delete','AdCategoryController@destroy');

        #广告分类管理
            #广告状态管理
            Route::get('ad/status','AdController@status');
            #产品列表页
            Route::get('ad','AdController@index');
            #载入添加页
            Route::get('ad/create','AdController@create');
            #提交产品数据
            Route::post('ad/store','AdController@store');
            #载入修改页
            Route::get('ad/{id}/edit','AdController@edit');
            #修改产品数据
            Route::post('ad/update/{id}','AdController@update');
            #删除产品
            Route::get('ad/delete','AdController@destroy');

        #微信管理
            #添加微信信息
            Route::get('wechat','WechatController@index');
            #提交微信数据
            Route::post('wechat/store','WechatController@store');

        #数据导出
            #数据导出 CSV
            Route::get('export/csv', 'ExportController@csv');
    }
);

/**
 * Test
 */
Route::group(['prefix' => 'test', 'namespace' => 'Test'], function () {
    Route::get('access_token', 'WechatController@accessToken');
    Route::get('server', 'WechatController@server');
}
);